<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	    		xmlns:ui="http://java.sun.com/jsf/facelets"
	  			xmlns:h="http://java.sun.com/jsf/html"
	  			xmlns:f="http://java.sun.com/jsf/core"
	  			xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:a="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:k="http://www.kvar.com.br/components"
				template="template.xhtml">

<ui:define name="page-name">
	<h:outputText value="Carteiras"/>
</ui:define>

<!-- content -->
<ui:define name="content">

<div class="section">
	<h:form id="postela123">
		<s:button
			id="criarCarteiras"
			value="Criar Carteira"
			view="/criarCarteira.xhtml"
			propagation="begin"/>
	</h:form>
</div>

<div class="section">
  	<h:form>
  	<rich:panel>
  	<f:facet name="header">
  		<h:outputText value="Carteiras"/>
  	</f:facet>
  	<h:outputText id="semCarteirasMessage" value="Sem Carteiras Cadastradas" rendered="#{empty carteiraList.resultList}"/>
	<rich:dataTable id="carteiras" value="#{carteiraList.resultList}" var="cart" rendered="#{not empty carteiraList.resultList}">
		<rich:column id="colId">
			<f:facet name="header">ID</f:facet>
			<h:outputText value="#{cart.id}" />
		</rich:column>
		<rich:column id="colNome">
			<f:facet name="header">Nome</f:facet>
			<h:outputText value="#{cart.nome}" />
		</rich:column>
		<rich:column id="atualizacao">
			<f:facet name="header">Atualizacao</f:facet>
			<h:outputText value="#{cart.ultimaAtualizacao}">
				<s:convertDateTime pattern="dd/MM/yyyy HH:mm:ss"/>
			</h:outputText>
		</rich:column>
		<rich:column id="usuario">
			<f:facet name="header">Usuario</f:facet>
			<h:outputText value="#{cart.usuario.username}" />
		</rich:column>
		<rich:column id="actions">
			<f:facet name="header"><h:outputText value="Acoes" /></f:facet>

			<h:commandButton id="editarCarteiras" action="#{carteiraHome.view}"
				value="Editar">
				<f:setPropertyActionListener value="#{cart}" target="#{carteiraHome.instance}" />
			</h:commandButton>

		</rich:column>
	</rich:dataTable>
	</rich:panel>
	</h:form>
</div>

</ui:define>


</ui:composition>
